package com.hhxy.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ghp
 * @date 2023/3/7
 * @title
 * @description 用于项目初始化测试
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping
    @PreAuthorize("hasAuthority('sys:test:list')")
    public String hello(){
        return "hello";
    }

    @PostMapping
    @PreAuthorize("@ex.hasAuthority('sys:test:list')")
    public String hello1(){
        return "自定义的权限校验方法";
    }
}
